package com.yoj.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户信息表
 */
@TableName(value = "user")
@ApiModel(value = "用户信息")
@Data
public class User implements Serializable {

    @ApiModelProperty(value = "用户 id", notes = "IdType.ASSIGN_ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户账号")
    @TableField(value = "userAccount")
    private String userAccount;

    @ApiModelProperty(value = "用户密码")
    @TableField(value = "userPassword")
    private String userPassword;

    @ApiModelProperty(value = "开放平台id")
    @TableField(value = "unionId")
    private String unionId;

    @ApiModelProperty(value = "公众号openId")
    @TableField(value = "mpOpenId")
    private String mpOpenId;

    @ApiModelProperty(value = "用户昵称")
    @TableField(value = "userName")
    private String userName;

    @ApiModelProperty(value = "用户头像")
    @TableField(value = "userAvatar")
    private String userAvatar;

    @ApiModelProperty(value = "用户简介")
    @TableField(value = "userProfile")
    private String userProfile;

    @ApiModelProperty(value = "用户角色", notes = "枚举类：user admin ban")
    @TableField(value = "userRole")
    private String userRole;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "updateTime")
    private Date updateTime;

    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}